package com.ruoyi.pets.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.pets.mapper.PetsRecommandMapper;
import com.ruoyi.pets.domain.PetsRecommand;
import com.ruoyi.pets.service.IPetsRecommandService;

/**
 * 宠物推荐Service业务层处理
 * 
 * @author isc
 * @date 2024-05-09
 */
@Service
public class PetsRecommandServiceImpl implements IPetsRecommandService 
{
    @Autowired
    private PetsRecommandMapper petsRecommandMapper;

    /**
     * 查询宠物推荐
     * 
     * @param id 宠物推荐主键
     * @return 宠物推荐
     */
    @Override
    public PetsRecommand selectPetsRecommandById(Long id)
    {
        return petsRecommandMapper.selectPetsRecommandById(id);
    }

    /**
     * 查询宠物推荐列表
     * 
     * @param petsRecommand 宠物推荐
     * @return 宠物推荐
     */
    @Override
    public List<PetsRecommand> selectPetsRecommandList(PetsRecommand petsRecommand)
    {
        return petsRecommandMapper.selectPetsRecommandList(petsRecommand);
    }

    /**
     * 新增宠物推荐
     * 
     * @param petsRecommand 宠物推荐
     * @return 结果
     */
    @Override
    public int insertPetsRecommand(PetsRecommand petsRecommand)
    {
        petsRecommand.setCreateTime(DateUtils.getNowDate());
        return petsRecommandMapper.insertPetsRecommand(petsRecommand);
    }

    /**
     * 修改宠物推荐
     * 
     * @param petsRecommand 宠物推荐
     * @return 结果
     */
    @Override
    public int updatePetsRecommand(PetsRecommand petsRecommand)
    {
        petsRecommand.setUpdateTime(DateUtils.getNowDate());
        return petsRecommandMapper.updatePetsRecommand(petsRecommand);
    }

    /**
     * 批量删除宠物推荐
     * 
     * @param ids 需要删除的宠物推荐主键
     * @return 结果
     */
    @Override
    public int deletePetsRecommandByIds(Long[] ids)
    {
        return petsRecommandMapper.deletePetsRecommandByIds(ids);
    }

    /**
     * 删除宠物推荐信息
     * 
     * @param id 宠物推荐主键
     * @return 结果
     */
    @Override
    public int deletePetsRecommandById(Long id)
    {
        return petsRecommandMapper.deletePetsRecommandById(id);
    }
}
